$.get('http://127.0.0.1:5001/task7').done(function (data) {
    var myeCharts = echarts.init(document.querySelector('chart'))
    console.log(data["vl2"]);
    console.log(data["vl3"]);
    var datas = []
    for (let i = 0; i < data["vl3"].length; i++) {
        datas.push(parseInt(data["vl3"][i]));
    }
    console.log(typeof datas)
    option = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        grid: {
            top: '20%',
            right: '3%',
            left: '15%',
            bottom: '25%',
            width: "210px",
            height: "120px"
        },
        title: {
            text: "各省水果分科销量",
            left: "center",
            y: "0%",
            textStyle: {
                color: '#fff',
                fontSize: '12'
            },
        },
        xAxis: {
            type: "category",
            data: data["vl2"],
            axisLine: {
                lineStyle: {
                    color: 'rgba(255,255,255,0.12)'
                }
            },
            axisLabel: {
                show: true,
                margin: 10,
                color: '#e2e9ff',
                rotate: 30,
                textStyle: {
                    fontSize: 7
                },
            },
        },
        yAxis: {
            type: "value",
            axisLabel: {
                formatter: function (data) {
                    return (data / 10000) + "万"
                },
                color: '#e2e9ff',
            },
            axisLine: {
                show: false,
                lineStyle: {
                    color: 'rgba(255,255,255,1)'
                }
            },
            splitLine: {
                lineStyle: {
                    color: 'rgba(255,255,255,0.5)'
                }
            }
        },
        series: [
            {
                data: datas,
                type: "scatter",
                symbolSize: function (val) {
                    // val 是数据项，这里可以根据 val 来动态计算大小
                    return val[1] / 10; // 假设 val[1] 是某个数据值，将其除以10得到标记大小
                },
                emphasis: {
                    focus: 'series',
                    label: {
                        show: true,
                        formatter: function (param) {
                            return param.data;
                        },
                        position: 'top'
                    }
                },
                itemStyle: {
                    shadowBlur: 10,
                    shadowColor: 'rgba(23,176,150, 0.8)',
                    shadowOffsetY: 5,
                    color: new echarts.graphic.RadialGradient(0.4, 0.3, 1, [
                        {
                            offset: 0,
                            color: 'rgb(23, 176, 150)'
                        },
                        {
                            offset: 1,
                            color: 'rgb(28, 210, 168)'
                        }
                    ])
                }
            }
        ]
    }
    console.log(option.series[0].symbolSize())
    myeCharts.setOption(option);
});